import axios from "axios"

export type DetailList = {
    name: string
    coverImgUrl: string
    description: string
    id: number
    playCount: number
    tags: string[]
    updateTime: number
    trackCount: number
    creator: {
        avatarUrl: string
        nickname: string
        userId: number
    }

}


export type GetPlayList = {
    cat:string
    code:number
    more:boolean
    total:number
    playlists:DetailList[]
}

export type Params = {
    limit:number
    offset:number
}

export const getPlayListApi = (params:Params) => {
    return axios.get<GetPlayList>('https://zyxcl.xyz/music/api/top/playlist',{
        params
    })
}